﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-datetimepicker.min.css" />
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
</head>
<body>
    <div id="searchPage"></div>
    <div style="margin-top: 20px;" class="main">
        <div class="wrap">
            <div class="panel panel-default">
                <div class="panel-heading"></div>
                <div class="panel-body">
                    <div class="form-wrap">
                        <div id="formValidate" class="form-horizontal">
                            <div class="form-group input-group">
                                <input type="text" placeholder="请输入高校名字" id="ProjectName" class="form-control"><span class="input-group-btn">
                                    <button type="button" class="btn btn-default" onclick="Go()">搜索</button>
                                </span>
                            </div>
                            <div class="form-group" id="divArea">
                                <label for="" class="radio-inline">活动地区：</label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="0"><span>不限</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300000"><span>广州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300001"><span>汕头市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300002"><span>湛江市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300003"><span>潮州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300004"><span>茂名市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300005"><span>深圳市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300006"><span>韶关市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300007"><span>梅州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300008"><span>惠州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300009"><span>东莞市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300010"><span>江门市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300011"><span>佛山市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300012"><span>肇庆市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300013"><span>珠海市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300014"><span>中山市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300015"><span>河源市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300016"><span>汕尾市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300017"><span>阳江市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300018"><span>清远市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300019"><span>揭阳市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300020"><span>云浮市</span>
                                </label>
                            </div>
                            <div class="form-group">
                                <select class="form-control" ng-change="confirm()" id="LikedCount">
                                    <option value="0">活动涉及学生总数</option>
                                    <option value="900000003">0-100</option>
                                    <option value="900000004">101-300</option>
                                    <option value="900000005">301-500</option>
                                    <option value="900000006">501-1000</option>
                                    <option value="900000007">1001-1500</option>
                                    <option value="900000008">1501-2500</option>
                                    <option value="900000009">2501-3000</option>
                                    <option value="900000010">3000以上</option>
                                </select>
                            </div>
                            <div class="form-group" id="divType">
                                <label for="">活动类型：</label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000041"><span>文艺类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000042"><span>表演类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000043"><span>晚会类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000044"><span>体育类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000045"><span>讲座类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000047"><span>其它</span>
                                </label>
                            </div>
                            <div class="form-group">
                                <label for="">活动时间：</label>
                                <input type="text" id="StartTime" style="display: inline-block;width: 110px;" data-error="请填写日期" required class="form-control datepick"><span> - </span>
                                <input type="text" id="EndTime" style="display: inline-block;width: 110px;" data-error="请填写日期" required class="form-control datepick">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <input type="number" id="Money" placeholder="活动需要金额" class="form-control">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="text-center">
                                <button type="button" class="btn btn-default" onclick="Go()">提交</button>
                            </div>
                            <div ng-app="myApp3" ng-controller="MyCtrl3">
                                <table style="margin-top: 20px;" class="table table-hover">
                                    <tr>
                                        <td>活动名称</td>
                                        <td>所属社团</td>
                                        <td>活动地区</td>
                                        <td>活动类型</td>
                                        <td>点赞数</td>
                                        <td>发布时间</td>
                                    </tr>
                                    <tr ng-repeat="x in names">
                                        <td><a href="activity-detail.html?id={{x.ProjectNO}}">{{x.ProjectName}}</a></td>
                                        <td>{{x.Association.Name}}</td>
                                        <td>{{ x.Association.ProvinceName +'-' +x.Association.CityName+'-'+ x.Association.SchoolName}}</td>
                                        <td><span ng-repeat="y in x.Type">{{y}}</span></td>
                                        <td>{{x.LikedCount}}</td>
                                        <td>{{x.CreateTime | date:'yyyy-MM-dd'}}</td>
                                    </tr>
                                    <!--<tr>
                                        <td><a href="./enterprise-activity-detail.html">周杰伦演唱会</a></td>
                                        <td>社团A</td>
                                        <td>广东省广州市</td>
                                        <td>晚会类</td>
                                        <td>99</td>
                                        <td>2016-01-01</td>
                                    </tr>-->
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script src="../js/jquery-1.12.2.min.js"></script>
<script src="../js/common.js"></script>
<script src="../js/login.js"></script>
<script src="../js/angular.min.js"></script>
<script src="../js/bootstrap-datetimepicker.js"></script>
<script src="../js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../js/sweetalert.min.js"></script>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Act");
    });

    $(function () {
        $('.datepick').datetimepicker({
            format: 'yyyy-mm-dd',
            language: 'zh-CN',
            minView: 2
        });
    });

    var param = common.getUrlArgStr();
    if (param.name != undefined) {
        common.commonAjax({ type: 'get', url: '../api/user/GetSchool?id=' + param.name, sMethod: AfteAjax1 });
    }

    var app = angular.module('myApp3', []);

    app.controller('MyCtrl3', function ($http, $scope) {
        $scope.update = function (data) {
            $scope.names = data;
            $scope.$apply();
        }
    });

    function AfteAjax1(ctx) {
        if (ctx == null) {
            alert("无数据.");
            return;
        }

        $("#ProjectName").val(ctx.ResponseStr);
    }

    function AfteAjax(ctx) {
        if (ctx == null) {
            alert("无数据.");
            return;
        }

        var ele = document.querySelector("[ng-controller=MyCtrl3]");

        angular.element(ele).scope().update(ctx.ResponseList);
    }

    function Go() {
        var values = common.GetCtrlValues({
            ContentID: "formValidate"
        })

        common.commonAjax({ type: 'Post', url: '../api/project/PostListActivity', data: values, sMethod: AfteAjax });
    }

    $(document).ready(function () {

        Go();

        $("#divArea [name='MoneyName']").each(function () {
            $(this).click(function () {
                Go();
            })
        });

        $("#LikedCount").change(function () {
            Go();
        })

        $("#divType [name='EntrantsName']").each(function () {
            $(this).change(function () {
                Go();
            })
        });
    })
</script>